package FileIO;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        File file = new File("./test.txt");

        file.createNewFile();

        System.out.println(file.exists());

//        file.delete();

        // 通过 deleteOnExit 删除文件, 退出程序时删除
        file.deleteOnExit();

        System.out.println(file.exists());

        //  通过 next 阻塞线程
        Scanner scanner = new Scanner(System.in);
        scanner.next();
    }
}
